using UnityEngine;

namespace SolarEngine
{
    // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig
    public class SESDKRemoteConfig : MonoBehaviour
    {
        
        #region SolarEngine.SESDKRemoteConfig.FetchRemoteConfigCallback
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.FetchRemoteConfigCallback
        public sealed class FetchRemoteConfigCallback : MulticastDelegate
        {
            // Methods
            public FetchRemoteConfigCallback(object object, IntPtr method)
            {
                var val_1;
                mem[1152921504930430416] = method;
                mem[1152921504930430440] = method;
                mem[1152921504930430432] = object;
                mem[1152921504930430464] = this;
                if((method & 1) == 0)
                {
                    goto label_0;
                }
                
                if(((method + 83) & 16) != 0)
                {
                    goto label_1;
                }
                
                if((method + 82) != 1)
                {
                    goto label_2;
                }
                
                val_1 = 4304228;
                goto label_9;
                label_0:
                if((method + 82) == 0)
                {
                    goto label_4;
                }
                
                if(object == null)
                {
                        throw 0;
                }
                
                label_2:
                mem[1152921504930430424] = ???;
                mem[1152921504930430464] = ???;
                goto label_6;
                label_1:
                if((method + 82) != 1)
                {
                    goto label_7;
                }
                
                val_1 = 4304244;
                goto label_9;
                label_4:
                val_1 = 4304196;
                goto label_9;
                label_7:
                val_1 = 4304288;
                label_9:
                mem[1152921504930430424] = val_1;
                label_6:
                mem[1152921504930430456] = 4304124;
            }
            public virtual void Invoke(string result)
            {
                goto x3;
            }
            public virtual System.IAsyncResult BeginInvoke(string result, System.AsyncCallback callback, object object)
            {
                return (System.IAsyncResult)this;
            }
            public virtual void EndInvoke(System.IAsyncResult result)
            {
            
            }
        
        }
        
        #endregion
        
        
        #region SolarEngine.SESDKRemoteConfig.FetchAllRemoteConfigCallback
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.FetchAllRemoteConfigCallback
        public sealed class FetchAllRemoteConfigCallback : MulticastDelegate
        {
            // Methods
            public FetchAllRemoteConfigCallback(object object, IntPtr method)
            {
                var val_1;
                mem[1152921504930430416] = method;
                mem[1152921504930430440] = method;
                mem[1152921504930430432] = object;
                mem[1152921504930430464] = this;
                if((method & 1) == 0)
                {
                    goto label_0;
                }
                
                if(((method + 83) & 16) != 0)
                {
                    goto label_1;
                }
                
                if((method + 82) != 1)
                {
                    goto label_2;
                }
                
                val_1 = 4304492;
                goto label_17;
                label_0:
                if((method + 82) == 0)
                {
                    goto label_4;
                }
                
                if(object == null)
                {
                        throw 0;
                }
                
                label_2:
                mem[1152921504930430424] = ???;
                mem[1152921504930430464] = ???;
                goto label_6;
                label_1:
                if((method + 82) != 1)
                {
                    goto label_7;
                }
                
                val_1 = 4304508;
                goto label_17;
                label_4:
                if(W8 == 0)
                {
                    goto label_9;
                }
                
                if((method & 1) == 0)
                {
                    goto label_10;
                }
                
                if((method & 1) == 0)
                {
                    goto label_11;
                }
                
                val_1 = 4304856;
                goto label_17;
                label_7:
                val_1 = 4304552;
                goto label_17;
                label_9:
                val_1 = 4304460;
                goto label_17;
                label_10:
                if((method & 1) == 0)
                {
                    goto label_15;
                }
                
                val_1 = 4304648;
                goto label_17;
                label_11:
                val_1 = 4304780;
                goto label_17;
                label_15:
                val_1 = 4304608;
                label_17:
                mem[1152921504930430424] = val_1;
                label_6:
                mem[1152921504930430456] = 4304388;
            }
            public virtual void Invoke(System.Collections.Generic.Dictionary<string, object> result)
            {
                goto x3;
            }
            public virtual System.IAsyncResult BeginInvoke(System.Collections.Generic.Dictionary<string, object> result, System.AsyncCallback callback, object object)
            {
                return (System.IAsyncResult)this;
            }
            public virtual void EndInvoke(System.IAsyncResult result)
            {
            
            }
        
        }
        
        #endregion
        
        
        #region SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedData
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedData
        private sealed class OnRemoteConfigReceivedData : AndroidJavaProxy
        {
            // Methods
            public OnRemoteConfigReceivedData()
            {
                if(mem[536882493] != 0)
                {
                        return;
                }
            
            }
            public void onResultForUnity(string result)
            {
                SolarEngine.SESDKRemoteConfig.OnFetchRemoteConfigCallback(result:  result);
            }
        
        }
        
        #endregion
        
        
        #region SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedAllData
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedAllData
        private sealed class OnRemoteConfigReceivedAllData : AndroidJavaProxy
        {
            // Methods
            public OnRemoteConfigReceivedAllData()
            {
                if(mem[536882493] != 0)
                {
                        return;
                }
            
            }
            public void onResultForUnity(string result)
            {
                Unknown val_1 = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Object>(value:  result);
                if(val_1 == 0)
                {
                        return;
                }
                
                SolarEngine.SESDKRemoteConfig.OnFetchAllRemoteConfigCallback(result:  val_1);
            }
        
        }
        
        #endregion
        
        
        #region SolarEngine.SESDKRemoteConfig.<>c__DisplayClass28_0
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.<>c__DisplayClass28_0
        private sealed class __c__DisplayClass28_0
        {
            // Fields
            public string result;
            
            // Methods
            public __c__DisplayClass28_0()
            {
            
            }
            internal void <OnFetchRemoteConfigCallback>b__0()
            {
                SolarEngine.SESDKRemoteConfig val_1 = SolarEngine.SESDKRemoteConfig.Instance;
                if(val_1.fetchRemoteConfigCallback_private == null)
                {
                        return;
                }
                
                SolarEngine.SESDKRemoteConfig val_2 = SolarEngine.SESDKRemoteConfig.Instance;
                27354032 = ???;
                goto x3;
            }
        
        }
        
        #endregion
        
        
        #region SolarEngine.SESDKRemoteConfig.<>c__DisplayClass30_0
        // [Assembly-CSharp.dll].SolarEngine.SESDKRemoteConfig.<>c__DisplayClass30_0
        private sealed class __c__DisplayClass30_0
        {
            // Fields
            public System.Collections.Generic.Dictionary<string, object> result;
            
            // Methods
            public __c__DisplayClass30_0()
            {
            
            }
            internal void <OnFetchAllRemoteConfigCallback>b__0()
            {
                SolarEngine.SESDKRemoteConfig val_1 = SolarEngine.SESDKRemoteConfig.Instance;
                if(val_1.fetchAllRemoteConfigCallback_private == null)
                {
                        return;
                }
                
                SolarEngine.SESDKRemoteConfig val_2 = SolarEngine.SESDKRemoteConfig.Instance;
                27354032 = ???;
                goto x3;
            }
        
        }
        
        #endregion
        
        // Fields
        protected static UnityEngine.AndroidJavaClass SeRemoteConfigAndroidSDK;
        protected static UnityEngine.AndroidJavaObject SeRemoteConfigAndroidSDKObject;
        private SolarEngine.SESDKRemoteConfig.FetchRemoteConfigCallback fetchRemoteConfigCallback_private;
        private SolarEngine.SESDKRemoteConfig.FetchAllRemoteConfigCallback fetchAllRemoteConfigCallback_private;
        private static System.Collections.Generic.List<System.Action> waitingTaskList;
        private static System.Collections.Generic.List<System.Action> executingTaskList;
        private static SolarEngine.SESDKRemoteConfig _instance;
        
        // Properties
        public static SolarEngine.SESDKRemoteConfig Instance { get; }
        
        // Methods
        public static SolarEngine.SESDKRemoteConfig get_Instance()
        {
            var val_13;
            IntPtr val_14;
            var val_15;
            var val_16;
            var val_17;
            var val_18;
            var val_19;
            val_13 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_13 = 536891969;
            }
            
            if((UnityEngine.Object.op_Implicit(exists:  mem[536892153] + 32)) == true)
            {
                goto label_14;
            }
            
            val_14 = 27356920;
            UnityEngine.Object val_3 = UnityEngine.Object.FindObjectOfType(type:  System.Type.GetTypeFromHandle(handle:  new System.RuntimeTypeHandle() {value = 1073762881}));
            val_15 = 536891969;
            if(mem[536892193] == 0)
            {
                goto label_6;
            }
            
            if(val_3 == null)
            {
                goto label_7;
            }
            
            label_10:
            val_16 = 0;
            goto label_9;
            label_6:
            val_15 = 536891969;
            if(val_3 != null)
            {
                goto label_10;
            }
            
            label_7:
            mem2[0] = 0;
            goto label_13;
            label_9:
            mem2[0] = ;
            label_13:
            if((UnityEngine.Object.op_Implicit(exists:  mem[536892153] + 32)) == true)
            {
                goto label_14;
            }
            
            536886569 = new UnityEngine.GameObject(name:  -1610604005);
            val_14 = 1073762881;
            UnityEngine.Component val_10 = val_8.AddComponent(componentType:  System.Type.GetTypeFromHandle(handle:  new System.RuntimeTypeHandle() {value = val_14}));
            val_17 = 536891969;
            if(mem[536892193] == 0)
            {
                goto label_17;
            }
            
            if(val_10 == null)
            {
                goto label_18;
            }
            
            label_21:
            val_18 = 0;
            goto label_20;
            label_17:
            val_17 = 536891969;
            if(val_10 != null)
            {
                goto label_21;
            }
            
            label_18:
            mem2[0] = 0;
            goto label_24;
            label_20:
            mem2[0] = ;
            label_24:
            label_14:
            val_19 = 536891969;
            if(mem[536892193] != 0)
            {
                    return (SolarEngine.SESDKRemoteConfig)mem[536892153] + 32;
            }
            
            val_19 = 536891969;
            return (SolarEngine.SESDKRemoteConfig)mem[536892153] + 32;
        }
        public static void PostTask(System.Action task)
        {
            var val_2;
            var val_3;
            var val_4;
            val_2 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_2 = 536891969;
            }
            
            System.Threading.Monitor.Enter(obj:  mem[536892153] + 16, lockTaken:  true);
            val_4 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_4 = 536891969;
            }
            
            if((mem[536892153] + 16) == 0)
            {
                    throw new NullReferenceException();
            }
            
            var val_2 = mem[536892153] + 16 + 28;
            var val_3 = mem[536892153] + 16 + 16;
            val_2 = val_2 + 1;
            mem2[0] = val_2;
            if((mem[536892153] + 16 + 24) < (mem[536892153] + 16 + 16 + 24))
            {
                    val_3 = val_3 + ((mem[536892153] + 16 + 24) << 3);
                mem2[0] = (mem[536892153] + 16 + 24) + 1;
                mem2[0] = task;
            }
            
            if(0 != 0)
            {
                    val_3 = 0;
                System.Threading.Monitor.Exit(obj:  mem[536892153] + 16);
            }
            
            if(0 != 0)
            {
                    throw new NullReferenceException();
            }
        
        }
        private void Update()
        {
            var val_2;
            object val_3;
            var val_4;
            var val_5;
            var val_6;
            var val_7;
            var val_8;
            var val_9;
            var val_10;
            object val_11;
            val_2 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_2 = 536891969;
            }
            
            val_3 = mem[mem[536892153] + 16];
            val_3 = mem[536892153] + 16;
            System.Threading.Monitor.Enter(obj:  val_3, lockTaken:  true);
            val_5 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_5 = 536891969;
            }
            
            val_6 = mem[536892153];
            if((mem[536892153] + 16) == 0)
            {
                    throw new NullReferenceException();
            }
            
            if((mem[536892153] + 16 + 24) >= 1)
            {
                    if(mem[536892193] == 0)
            {
                    val_6 = mem[536892153];
            }
            
                val_5 = mem[mem[536892153] + 24];
                val_5 = mem[536892153] + 24;
                if(val_5 == 0)
            {
                    throw new NullReferenceException();
            }
            
                val_5.AddRange(collection:  mem[536892153] + 16);
                var val_2 = mem[536892153] + 16 + 24 + 4;
                val_2 = val_2 + 1;
                mem2[0] = 0;
                mem2[0] = val_2;
                if((mem[536892153] + 16 + 24) >= 1)
            {
                    System.Array.Clear(array:  mem[536892153] + 16 + 16, index:  0, length:  mem[536892153] + 16 + 24);
            }
            
            }
            
            val_7 = 0;
            val_8 = 3;
            label_33:
            if(0 != 0)
            {
                    val_4 = 0;
                System.Threading.Monitor.Exit(obj:  val_3);
            }
            
            if(val_7 != 0)
            {
                goto label_10;
            }
            
            if(3 != 3)
            {
                    if(3 != 0)
            {
                    return;
            }
            
            }
            
            val_7 = 27346264;
            val_8 = 27345240;
            val_3 = 0;
            label_19:
            val_9 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_9 = 536891969;
            }
            
            val_10 = mem[mem[536892153] + 24];
            val_10 = mem[536892153] + 24;
            if(val_10 == 0)
            {
                    throw new NullReferenceException();
            }
            
            val_11 = mem[mem[536892153] + 24 + 24];
            val_11 = mem[536892153] + 24 + 24;
            if(mem[536892193] == 0)
            {
                    val_9 = mem[536892153];
                val_10 = mem[mem[536892153] + 24];
                val_10 = mem[536892153] + 24;
                if(val_10 == 0)
            {
                    throw new NullReferenceException();
            }
            
            }
            
            if(val_3 >= val_11)
            {
                goto label_17;
            }
            
            if(val_10.Item[0] == 0)
            {
                    throw new NullReferenceException();
            }
            
            val_3 = val_3 + 1;
            goto label_19;
            label_17:
            var val_3 = mem[536892153] + 24 + 24 + 4;
            val_3 = val_3 + 1;
            mem2[0] = 0;
            mem2[0] = val_3;
            if((mem[536892153] + 24 + 24) < 1)
            {
                    return;
            }
            
            System.Array.Clear(array:  mem[536892153] + 24 + 16, index:  0, length:  mem[536892153] + 24 + 24);
            return;
            label_10:
            val_5 = val_7;
            throw new NullReferenceException();
            label_36:
            val_5 = ;
            if( != 1)
            {
                goto label_34;
            }
            
            goto label_33;
            label_34:
            if(0 != 0)
            {
                    System.Threading.Monitor.Exit(obj:  val_3);
            }
            
            if(0 == 0)
            {
                goto label_36;
            }
        
        }
        public void SetRemoteDefaultConfig(System.Collections.Generic.Dictionary<string, object>[] defaultConfig)
        {
            this.SESDKSetRemoteDefaultConfig(defaultConfig:  defaultConfig);
        }
        public void SetRemoteConfigEventProperties(System.Collections.Generic.Dictionary<string, object> properties)
        {
            this.SESDKSetRemoteConfigEventProperties(properties:  properties);
        }
        public void SetRemoteConfigUserProperties(System.Collections.Generic.Dictionary<string, object> properties)
        {
            this.SESDKSetRemoteConfigUserProperties(properties:  properties);
        }
        public string FastFetchRemoteConfig(string key)
        {
            return this.SESDKFastFetchRemoteConfig(key:  key);
        }
        public System.Collections.Generic.Dictionary<string, object> FastFetchRemoteConfig()
        {
            return this.SESDKFastFetchAllRemoteConfig();
        }
        public void AsyncFetchRemoteConfig(string key, SolarEngine.SESDKRemoteConfig.FetchRemoteConfigCallback callback)
        {
            SolarEngine.SESDKRemoteConfig val_1 = SolarEngine.SESDKRemoteConfig.Instance;
            val_1.fetchRemoteConfigCallback_private = callback;
            val_1 + 24.SESDKAsyncFetchRemoteConfig(key:  key);
        }
        public void AsyncFetchRemoteConfig(SolarEngine.SESDKRemoteConfig.FetchAllRemoteConfigCallback callback)
        {
            SolarEngine.SESDKRemoteConfig val_1 = SolarEngine.SESDKRemoteConfig.Instance;
            val_1.fetchAllRemoteConfigCallback_private = callback;
            val_1 + 32.SESDKAsyncFetchAllRemoteConfig();
        }
        private void SESDKSetRemoteDefaultConfig(System.Collections.Generic.Dictionary<string, object>[] defaultConfig)
        {
            var val_2;
            if(defaultConfig == null)
            {
                    return;
            }
            
            val_2 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_2 = 536891969;
            }
            
            if(mem[536881369] == 0)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881377] = Newtonsoft.Json.JsonConvert.SerializeObject(value:  defaultConfig);
            mem[536892153].CallStatic(methodName:  -1610596267, args:  536881345);
        }
        private void SESDKSetRemoteConfigEventProperties(System.Collections.Generic.Dictionary<string, object> properties)
        {
            var val_2;
            if(properties == null)
            {
                    return;
            }
            
            val_2 = 27373352;
            if((-1073733223) == 0)
            {
                    val_2 = 27373352;
            }
            
            if(mem[536881369] == 0)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881377] = Newtonsoft.Json.JsonConvert.SerializeObject(value:  properties);
            mem[3221288297].CallStatic(methodName:  -1610596271, args:  536881345);
        }
        private void SESDKSetRemoteConfigUserProperties(System.Collections.Generic.Dictionary<string, object> properties)
        {
            var val_2;
            if(properties == null)
            {
                    return;
            }
            
            val_2 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_2 = 536891969;
            }
            
            if(mem[536881369] == 0)
            {
                    throw new ArrayTypeMismatchException();
            }
            
            mem[536881377] = Newtonsoft.Json.JsonConvert.SerializeObject(value:  properties);
            mem[536892153].CallStatic(methodName:  -1610596269, args:  536881345);
        }
        private string SESDKFastFetchRemoteConfig(string key)
        {
            var val_1;
            if(key == null)
            {
                    return 0;
            }
            
            val_1 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_1 = 536891969;
            }
            
            if(mem[536881369] != 0)
            {
                    mem[536881377] = key;
                return mem[536892153].CallStatic<System.Object>(methodName:  -1610598725, args:  536881345);
            }
        
        }
        private System.Collections.Generic.Dictionary<string, object> SESDKFastFetchAllRemoteConfig()
        {
            if(mem[536892193] != 0)
            {
                    return (System.Collections.Generic.Dictionary<System.String, System.Object>)Newtonsoft.Json.JsonConvert.DeserializeObject<System.Object>(value:  mem[536892153].CallStatic<System.Object>(methodName:  -1610598725, args:  mem[3221276963] + 184));
            }
            
            536891969 = 536891969;
            return (System.Collections.Generic.Dictionary<System.String, System.Object>)Newtonsoft.Json.JsonConvert.DeserializeObject<System.Object>(value:  mem[536892153].CallStatic<System.Object>(methodName:  -1610598725, args:  mem[3221276963] + 184));
        }
        private void SESDKAsyncFetchAllRemoteConfig()
        {
            if(mem[536892193] == 0)
            {
                    536891969 = 536891969;
            }
            
            SolarEngine.SESDKRemoteConfig.SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedAllData val_1 = 536900011;
            val_1 = new SolarEngine.SESDKRemoteConfig.SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedAllData();
            if(mem[536881369] != 0)
            {
                    mem[536881377] = val_1;
                mem[536892153].CallStatic(methodName:  -1610600193, args:  536881345);
                return;
            }
        
        }
        private void SESDKAsyncFetchRemoteConfig(string key)
        {
            var val_2;
            if(key == null)
            {
                    return;
            }
            
            val_2 = 536891969;
            if(mem[536892193] == 0)
            {
                    val_2 = 536891969;
            }
            
            if(mem[536881369] != 0)
            {
                    mem[536881377] = key;
                SolarEngine.SESDKRemoteConfig.SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedData val_1 = 536900013;
                val_1 = new SolarEngine.SESDKRemoteConfig.SolarEngine.SESDKRemoteConfig.OnRemoteConfigReceivedData();
                if(mem[536881369] > 1)
            {
                    mem[536881385] = val_1;
                mem[536892153].CallStatic(methodName:  -1610600193, args:  536881345);
                return;
            }
            
            }
        
        }
        private static void OnFetchRemoteConfigCallback(string result)
        {
            object val_1 = 536899999;
            val_1 = new System.Object();
            mem[536900015] = result;
            System.Action val_2 = 536881997;
            val_2 = new System.Action(object:  val_1, method:  1610678175);
            SolarEngine.SESDKRemoteConfig.PostTask(task:  val_2);
        }
        private static void OnFetchAllRemoteConfigCallback(System.Collections.Generic.Dictionary<string, object> result)
        {
            object val_1 = 536900001;
            val_1 = new System.Object();
            mem[536900017] = result;
            System.Action val_2 = 536881997;
            val_2 = new System.Action(object:  val_1, method:  1610678179);
            SolarEngine.SESDKRemoteConfig.PostTask(task:  val_2);
        }
        public SESDKRemoteConfig()
        {
        
        }
        private static SESDKRemoteConfig()
        {
            UnityEngine.AndroidJavaClass val_1 = 536882247;
            val_1 = new UnityEngine.AndroidJavaClass(className:  -1610599699);
            mem2[0] = val_1;
            UnityEngine.AndroidJavaObject val_2 = 536882257;
            val_2 = new UnityEngine.AndroidJavaObject(className:  -1610599699, args:  mem[3221276963] + 184);
            mem2[0] = val_2;
            System.Collections.Generic.List<System.Object> val_3 = 536903657;
            val_3 = new System.Collections.Generic.List<System.Object>();
            mem2[0] = val_3;
            System.Collections.Generic.List<System.Object> val_4 = 536903657;
            val_4 = new System.Collections.Generic.List<System.Object>();
            mem2[0] = val_4;
            mem2[0] = 0;
            throw new NullReferenceException();
        }
    
    }

}
